<%--
XPTracker - Alternative Agile Tracking Tool
Copyright (C) 2006-2009  Stephen Starkey

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
--%>
<%@ include file="/taglibs.jsp" %>
<s:layout-render name="/layout/normal.jsp">
  <s:layout-component name="htmlHead">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/search.css"></link> 
  </s:layout-component>
  <s:layout-component name="body">
  <s:useActionBean beanclass="org.xptracker.web.SearchActionBean" var="searchBean"/>
    <c:choose>
      <c:when test="${empty searchBean.searchResults && empty searchBean.wikiSearchResults}">
        <em>No results found.</em>
      </c:when>
      <c:otherwise>
        <script type="text/javascript">
          function toggleSearchResults(prefix) {
            Element.toggle($(prefix + 'ResultsExpand'));
            Element.toggle($(prefix + 'Results'));
          }
        </script>
        <c:if test="${!empty searchBean.searchResults}">
          <div class="search-results-heading" id="storyResultsExpand" style="display:none"
               onclick="toggleSearchResults('story')">+ Story Results</div>
          <div id="storyResults">
            <%@include file="storySearchResults.jsp" %>
          </div>
        </c:if>
        <c:if test="${!empty searchBean.wikiSearchResults}">
          <div class="search-results-heading" id="wikiResultsExpand" style="display:none"
               onclick="toggleSearchResults('wiki')">+ Wiki Results</div>
          <div id="wikiResults">
            <%@include file="wikiSearchResults.jsp" %>
          </div>
        </c:if>
      </c:otherwise>
    </c:choose>
    </s:layout-component>
</s:layout-render>